package operation.impl;

import book.BookList;
import operation.IOperation;

public class ReturnOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("您现在进行的是还书操作~");
        System.out.println("请输入您要归还的书目书名->");
        String booksName = scanner.next();
        if (bookList.isContains(booksName)){
            bookList.returnBook(booksName);
            System.out.println("还书成功！");
        }else{
            System.err.println("没有被借出，不需要还~");
        }
    }
}
